package com.hst.capacity.infra.persistence.jpa.fleet;


import com.hst.capacity.domain.model.entity.franchisee.FleetEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface FleetInforRepository extends JpaRepository<FleetEntity, String>, JpaSpecificationExecutor<FleetEntity>{


    FleetEntity findByIdFleet(String idFleet);

    FleetEntity findByFleetTel(String fleetTel);

    @Query("select count(idFleet) from FleetEntity where idAgent=?1")
    int getFleetCountByAgent(String idAgent);

    @Query("select count(idFleet) from FleetEntity where idFranchisee=?1")
    int getFleetCountByFran(String idFranchisee);
}
